<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTrashSitesTable extends Migration
{
    /**
     * Run the migrations.
     * 垃圾点位统计表
     *
     * @return void
     */
    public function up()
    {
        Schema::create('trash_sites', function (Blueprint $table) {
            $table->increments('id');
            $table->string('mark',20)->comment('编号')->nullable();
            $table->string('name')->comment('垃圾点位');
            $table->string('address')->comment('详细地址');
            $table->point('location')->comment('经纬度')->nullable();
            $table->string('company')->comment('所属公司')->nullable();
            $table->char('type',1)->comment('垃圾类型，1 有害垃圾，2 可回收垃圾，3 干垃圾 4 湿垃圾')->nullable();
            $table->char('mold',1)->comment('容器类型 1果皮箱 2垃圾箱 3垃圾桶')->default(1);
            $table->integer('number')->unsigned()->comment('总数量')->nullable();
            $table->float('bulk')->comment('总容积')->nullable();
            $table->integer('clean_num')->unsigned()->comment('日清运次数')->nullable();
            $table->integer('path')->unsigned()->comment('路线')->nullable();
            $table->string('clean_time')->comment('清运时间范围')->nullable();
            $table->float('bulk_avg')->comment('日均垃圾容量')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('trash_sites');
    }
}
